package com.ybkj.daijia.server.model;

import java.math.BigDecimal;

/**
 * 提成详细表
 *
 * @author Shine
 */
public class DriverLevelMoneyDetail extends Base {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private BigDecimal fromMoney;// 从fromMoney元

    private BigDecimal toMoney;// 到toMoney元

    private DriverLevelMoneyType driverLevelMoneyType;//类型 比例 固定

    private BigDecimal moneyUnit;// 每moneyUnit元

    private BigDecimal commission;// 比例提成

    private BigDecimal money;// 固定提成

    private Long moneyTimeId;

    public BigDecimal getFromMoney() {
        return fromMoney;
    }

    public void setFromMoney(BigDecimal fromMoney) {
        this.fromMoney = fromMoney;
    }

    public BigDecimal getToMoney() {
        return toMoney;
    }

    public void setToMoney(BigDecimal toMoney) {
        this.toMoney = toMoney;
    }

    public DriverLevelMoneyType getDriverLevelMoneyType() {
        return driverLevelMoneyType;
    }

    public void setDriverLevelMoneyType(DriverLevelMoneyType driverLevelMoneyType) {
        this.driverLevelMoneyType = driverLevelMoneyType;
    }

    public BigDecimal getMoneyUnit() {
        return moneyUnit;
    }

    public void setMoneyUnit(BigDecimal moneyUnit) {
        this.moneyUnit = moneyUnit;
    }

    public BigDecimal getCommission() {
        return commission;
    }

    public void setCommission(BigDecimal commission) {
        this.commission = commission;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public Long getMoneyTimeId() {
        return moneyTimeId;
    }

    public void setMoneyTimeId(Long moneyTimeId) {
        this.moneyTimeId = moneyTimeId;
    }

    public boolean isEmpty() {

        if (null == driverLevelMoneyType) {
            return true;
        }

        if (driverLevelMoneyType.equals(DriverLevelMoneyType.ticheng)) {
            if (null == fromMoney || null == toMoney || null == commission) {
                return true;
            }
        } else if (driverLevelMoneyType.equals(DriverLevelMoneyType.guding)) {
            if (null == fromMoney || null == toMoney || null == moneyUnit || null == money) {
                return true;
            }
        }

        return false;

    }

    public enum DriverLevelMoneyType {
        /**
         * 比例提成
         */
        ticheng,
        /**
         * 固定提成
         */
        guding
    }
}
